package com.qq.server.model;

import java.util.HashMap;
import java.util.Iterator;

public class manageSocket {
	
	public static HashMap hm = new HashMap<String, transferMsg>();

	public static void addtransferMsg(String owner, transferMsg tm){
		hm.put(owner, tm);
	} 
	
	public static transferMsg getTransferMsg(String ownerId){
		return (transferMsg)hm.get(ownerId);
	}
	
	public static StringBuffer returnUsers(){
		Iterator it = hm.keySet().iterator();
		StringBuffer onlineUsers = new StringBuffer();
		while (it.hasNext()){
			String user = (String) it.next();
			onlineUsers.append(user + " ");
		}
		return onlineUsers;
	}
	
	
}
